<?
require_once ('../../models/Customer.php');
$customer = Customer::GetAll();
?>

<!DOCTYPE html>
<html lang="en">
	<? include('../../inc/head.php'); ?>
	<body>
		<div>
			<? include('../../inc/nav.php'); ?>

			<div id="content">
				<h3>Customer Table</h3>
				<table class="table table-bordered table-condensed table-hover table-striped">
		
					<tr>
						<th>ID</th></th><th>Name</th><th>DOB</th><th>Adress</th><th>Phone_Number</th><th>Actions</th>
					</tr>
		
					<? while($row = $customer->fetch_assoc()): ?>
						<tr>
							<td><?=$row['idCustomer']?></td></td><td><?=$row['Cust_Name']?></td><td><?=$row['Cust_DOB']?></td><td><?=$row['Cust_BillingAddress']?></td><td><?=$row['Cust_PhoneNum']?></td>
							<td>
								<a href="details.php?id=<?=$row['idCustomer']?>">Details</a>
								<a href="edit.php?id=<?=$row['idCustomer']?>">Edit</a>
								<a href="delete.php?id=<?=$row['idCustomer']?>">Delete</a>
							</td>					
						</tr>
					<? endwhile; ?>
					<tr><td><a href="create.php">Insert New Values</a></td></tr>
				</table>
								
			</div>
			<? include('../../inc/footer.php'); ?>
		</div>
	</body>
</html>